from manimlib import *

class TextAnimation(Scene):
    def construct(self):
        title = Text("这是廖廷皞的动画", font = "Source Han Sans", font_size = 90)
        text1 = Text("You can set color了", font = "Source Han Sans", font_size = 80,
            t2c = {"color": RED, "了": BLUE},
            t2s = {"can": ITALIC})
        text2 = Text("You can set font of word", font = "Source Han Sans", font_size = 80,
            t2f = {"font": "Bauhaus"})

        self.play(FadeIn(title, UP)) #以上升的方式呈现文字
        self.wait(0)
        self.play(FadeOut(title, UP))
        self.wait(0)
        self.play(FadeIn(text1, UP))
        self.wait(0)
        self.play(FadeOut(text1, UP))
        self.wait(0)
        self.play(FadeIn(text2, UP))
        self.wait(0)
        self.play(FadeOut(text2, DOWN))
        self.embed()